﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DiscountDetail.aspx.cs" Inherits="famails.BackEnd.Customer.DiscountDetail" %>

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>Đăng ký thành công</title>
</head>
<link href="../../Content/bootstrap.css" rel="stylesheet">
<link href="../../Images/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<link href="../../font-awesome/css/font-awesome.css" rel="stylesheet">
<link href="../../css/dataTables.bootstrap.css" rel="stylesheet" />
<link href='http://fonts.googleapis.com/css?family=Roboto&subset=latin,vietnamese' rel='stylesheet' type='text/css'>
<style>
    body {
        font-family: 'Roboto', sans-serif;
        margin: 0px auto;
        padding: 0px;
    }
</style>
<body>
    <div class="panel-body" style="margin: 10px; width: auto;">
        <center>
            <div id="btnExportExcel" onclick="tableToExcel('dataTables-example')" style="background: none; width:150px;color: #333; text-align: center; padding: 6px 15px; border-radius: 0px; border: 2px solid #333;" class="btn">
                <span style="margin-right: 10px;color:#333;" class="fa fa-mail-forward"></span>Xuất dữ liệu
            </div>
        </center>
        <div class="col-md-12" style="padding: 5px 0px; margin: 10px 0px; border-bottom: 1px solid #ddd;">
            <div class="col-md-6" style="text-align: left; padding: 5px">
                <div class="col-md-12" style="padding: 5px 0px;">
                    <div class="col-md-2" style="padding: 0px 5px;">
                        Tên sự kiện :
                    </div>
                    <div class="col-md-10" style="padding: 0px 5px; font-weight: bold; overflow: hidden;">
                        <asp:Label runat="server" ID="lblDiscountName"></asp:Label>
                    </div>
                </div>
                <div class="col-md-12" style="padding: 5px 0px;">
                    <div class="col-md-2" style="padding: 0px 5px;">
                        Ghi chú
                    </div>
                    <div class="col-md-10" style="padding: 0px 5px; font-weight: bold; color: #aaa;">
                        <asp:Label runat="server" ID="lblNotes"></asp:Label>
                    </div>
                </div>

            </div>
            <div class="col-md-2" style="text-align: right; padding: 5px">
                <div class="col-md-12" style="padding: 5px 0px;">
                    Số lượng Code : <b>
                        <asp:Label runat="server" ID="lblNumberOfCode"></asp:Label></b>
                </div>
                <div class="col-md-12" style="padding: 5px 0px;">
                    Giá trị áp dụng : <b>
                        <asp:Label runat="server" ID="lblMinValue"></asp:Label></b>
                </div>

            </div>
            <div class="col-md-4" style="text-align: right; padding: 5px">
                <div class="col-md-12" style="padding: 5px 0px;">
                    Hình thức khuyến mãi : <b>
                        <asp:Label runat="server" ID="lblDiscountType"></asp:Label></b>
                </div>
                <div class="col-md-12" style="padding: 5px 0px;">
                    Bắt đầu : <b>
                        <asp:Label runat="server" ID="lblFrom"></asp:Label></b>
                </div>
                <div class="col-md-12" style="padding: 5px 0px;">
                    Kết thúc : <b><asp:Label runat="server" ID="lblTo"></asp:Label></b>
                </div>
            </div>
        </div>
        <div style="width: 100%">
            <div class="table-responsive" style="border: 0px; margin-top: 10px;">
                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                    <thead>
                        <tr>
                            <th style="text-align: center; width: 80px;">STT</th>
                            <th style="text-align: center; width: 150px;">Mã code</th>
                            <th style="text-align: center; width: 150px;">Loại code</th>
                            <th style="text-align: center;">Giá trị đã dùng</th>
                            <th style="text-align: center;">Tên khách hàng sử dụng</th>
                            <th style="text-align: center;">Mã đơn hàng sử dụng</th>
                        </tr>
                    </thead>
                    <tbody>
                        <asp:Repeater runat="server" ID="rptOrders">
                            <ItemTemplate>
                                <tr>
                                    <td style="vertical-align: middle; text-align: center;"><%#Container.ItemIndex+1 %></td>
                                    <td style="vertical-align: middle; text-align: center;"><%#Eval("DiscountCode") %></td>
                                    <td style="vertical-align: middle; text-align: center;"><%#(Eval("Fix0_Per1")+""=="0"?Convert.ToDecimal(Eval("DiscountValue")).ToString("#,##0"):Eval("DiscountValue")+"%") %></td>
                                    <td style="vertical-align: middle; text-align: center;"><%#Convert.ToDecimal(Eval("DiscountAmount")).ToString("#,##0") %></td>
                                    <td style="vertical-align: middle; text-align: center;"><%#Eval("CustomerName") %></td>
                                    <td style="vertical-align: middle; text-align: center;"><%#Eval("OrderCode") %></td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                        <%-- <tr>
                            <td style="vertical-align: middle; text-align: center;">2</td>
                            <td style="vertical-align: middle; text-align: center;">ADK343B</td>
                            <td style="vertical-align: middle; text-align: center;">10%</td>
                            <td style="vertical-align: middle; text-align: center;"></td>
                            <td style="vertical-align: middle; text-align: center;"></td>
                            <td style="vertical-align: middle; text-align: center;"></td>
                        </tr>
                        <tr>
                            <td style="vertical-align: middle; text-align: center;">3</td>
                            <td style="vertical-align: middle; text-align: center;">ADK343A</td>
                            <td style="vertical-align: middle; text-align: center;">200,000</td>
                            <td style="vertical-align: middle; text-align: center;">200,000</td>
                            <td style="vertical-align: middle; text-align: center;">SDA358</td>
                            <td style="vertical-align: middle; text-align: center;">HD7731</td>
                        </tr>
                        <tr>
                            <td style="vertical-align: middle; text-align: center;">4</td>
                            <td style="vertical-align: middle; text-align: center;">ADK3445</td>
                            <td style="vertical-align: middle; text-align: center;">200,000</td>
                            <td style="vertical-align: middle; text-align: center;"></td>
                            <td style="vertical-align: middle; text-align: center;"></td>
                            <td style="vertical-align: middle; text-align: center;"></td>
                        </tr>--%>
                    </tbody>
                </table>
            </div>
        </div>
        <!-- /.table-responsive -->
    </div>

    <!-- Call Jquery -->
    <script src="../../Scripts/jquery-1.9.0.js"></script>
    <script src="../../Scripts/bootstrap.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery.dataTables.js"></script>
    <script type="text/javascript" src="../../Scripts/dataTables.bootstrap.js"></script>
    <script>
        jQuery(function () {
            $('#dataTables-example').dataTable({
                "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]/*,
            "dom": 'T&lt;"clear"&gt;lfrtip',
            "tableTools": {
                "sSwfPath": "../resource/TableTools/media/swf/ZeroClipboard.swf"
            }*/
            });
        });
    </script>

    <script>
        var tableToExcel = (function () {
            var uri = 'data:application/vnd.ms-excel;base64,'
                , template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>'
                , base64 = function (s) { return window.btoa(unescape(encodeURIComponent(s))) }
                , format = function (s, c) { return s.replace(/{(\w+)}/g, function (m, p) { return c[p]; }) }
            return function (table, name) {
                if (!table.nodeType) table = document.getElementById(table)
                var ctx = { worksheet: name || 'Worksheet', table: table.innerHTML }
                window.location.href = uri + base64(format(template, ctx))
            }
        })()
    </script>

</body>
</html>

